# -*- mode: snippet -*-
# name: makefile template
# key: make
# group: oracleyue
# expand-env: ((yas-indent-line 'fixed))
# --
CC = clang
CXX = clang++
CFLAGS = -I/usr/local/include/gsl -c
CPPFLAGS = -I/usr/local/include/eigen3 -c
LFLAGS = -lm

vpath %.c src
vpath %.h include
vpath %.cpp src
vpath %.hpp include

# ------- SOURCE FILES ---------------------
# Editing here to set your source files
# ---
source  = second.cpp
# ------------------------------------------
object = $(patsubst %.c,obj/%.o,$(source))
object = $(patsubst %.cpp,obj/%.o,$(source))


# ------ COMPILING ------
run: $(object)
	$(CXX) $(LFLAGS) $(object) -o run

$(object): | obj
obj:
	@mkdir -p $@

obj/%.o: %.cpp
	@echo $^
	$(CXX) $(CPPFLAGS) $< -o $@


# ------ CLEANING ------
dist-clean:
	rm -f $(object)
clean:
	rm -f run $(object)


# ------ MISC. ------
.PHONY: run clean dist-clean
